package com.tedu.feedPostModerationManagement.controller;

import com.tedu.common.response.JsonResult;
import com.tedu.common.response.PageData;
import com.tedu.feedPostModerationManagement.pojo.dto.FeedPostModerationManagementQuery;
import com.tedu.feedPostModerationManagement.pojo.dto.FeedPostModerationManagementUpdate;
import com.tedu.feedPostModerationManagement.service.FeedPostModerationManagementService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/p1/admin/")
@Slf4j
public class FeedPostModerationManagementController {
    @Autowired
    FeedPostModerationManagementService feedPostModerationManagementService;
    @GetMapping("posts")
    public JsonResult selectAllVariables(FeedPostModerationManagementQuery feedPostModerationManagementQuery) {
        log.debug("查询的数据是:{}", feedPostModerationManagementQuery);
        PageData data = feedPostModerationManagementService.selectAllVariables(feedPostModerationManagementQuery);
        return JsonResult.ok(data);
    }
    @PostMapping("posts/status")
    public JsonResult insertMediaVariables(FeedPostModerationManagementUpdate mediaVariables) {
        log.debug("插入的数据是:{}", mediaVariables);
        feedPostModerationManagementService.isPassOrRefuse(mediaVariables);
        return JsonResult.ok();
    }
}
